import sys
from coin.base.datetime_util import to_datetime
import pandas as pd
import matplotlib
matplotlib.use('agg', warn=False, force=True)
import matplotlib.pyplot as plt

csv_path = sys.argv[1]
df = pd.read_csv(csv_path)
df['time'] = pd.to_datetime(df['time'])
df = df.set_index('time')

mid_price = df.loc[:, 'mid_price']
imbalance = df.loc[:, 'imbalance']
pnl = df.loc[:, 'pnl']
pos = df.loc[:, 'pos']
sum = df.loc[:, 'imbalance'] / 10000

fig, ax = plt.subplots(figsize=(18, 10))
#((mid_price - mid_price[0]) * 10).plot(ax=ax)

plt.figure(figsize=(100, 50))
plt.plot(pos * 100)
plt.plot(sum * 100)
plt.plot(pnl)
plt.savefig('output.png')
